package com.etc.medical.feign;

import com.etc.common.utils.Result;
import com.etc.medical.client.ExamineClient;
import com.etc.medical.client.OutpatientClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletResponse;

@RestController
@CrossOrigin(origins = "*")
@RequestMapping("/examine")
public class ExamineFeign {

    @Resource
    private ExamineClient examineClient;

    @Resource
    private OutpatientClient outpatientClient;
    /**
     * 查询职位为检查医生的所有在职医生
     */
    @RequestMapping("/queryExamineDoc")
    public Result queryExamineDoc(){
        return examineClient.queryExamineDoc();
    }

    /**
     * 根据门诊id查询检查信息
     *
     * @param osId
     * @return
     */
    @RequestMapping("/queryExamine")
    public Result queryExamine(@RequestParam("osId") String osId) {
        return examineClient.queryExamine(osId);
    }

    /**
     * 根据医生id查询门诊
     *
     * @param docId
     * @return
     */
    @RequestMapping("/queryOutpatient")
    public Result queryOutpatient(@RequestParam("docId") String docId) {
        return outpatientClient.queryOutpatient(docId);
    }

    /**
     * 图片上传
     *
     * @param file
     * @return
     */
    @RequestMapping(method = RequestMethod.POST, value = "/uploadFile")
    public Result uploadFile(@RequestParam("file") MultipartFile file, @RequestParam("examineId") String examineId) {
        return examineClient.uploadFile(file, examineId);
    }

}
